<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns="http://www.w3.org/1999/xhtml"
            xmlns:h="http://java.sun.com/jsf/html">
<h:form>
    <h:outputText style="font-weight: bold" value="Choose a client from the table below:" />
    <h:selectOneMenu value="#{salesInquiryBean.clientId}">
        <f:selectItems value="#{salesInquiryBean.clients}" var="c"
                       itemLabel="#{c.id}. #{c.companyName} - #{c.name} [#{c.clientStatus}]" itemValue="#{c.id}" />
    </h:selectOneMenu>


    <h:dataTable cellpadding="3px" cellspacing="16px" styleClass="allaroundborder" headerClass="allaroundborder" columnClasses="allaroundborder"
                 rowClasses="allaroundborder" value="#{salesInquiryBean.clients}" var="client">

        <h:column>
            <f:facet name="header">
                <h:outputText value="Client Id" />
            </f:facet>
            <h:outputText value="#{client.id}" />
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="Name" />
            </f:facet>
            <h:outputText value="#{client.name}" />
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="Company Name" />
            </f:facet>
            <h:outputText value="#{client.companyName}" />
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="Company Address" />
            </f:facet>
            <h:outputText value="#{client.companyAddress}" />
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="Business Type" />
            </f:facet>
            <h:outputText value="#{client.businessType}" />
        </h:column>

    </h:dataTable>
    <h:commandButton action="index.xhtml" value="Cancel" />
    <br/><br/>
    <h:commandButton action="addSalesInquiryItem.xhtml" value="Add a Sales Inquiry Item" actionListener="#{salesInquiryBean.addNewSalesInquiry}" />
</h:form>
</ui:composition>
